package example.java.util.Comparator;

import java.util.Comparator;

import org.apache.log4j.Logger;

import example.commons.beans.Person;

public class PersonComparatorByName implements Comparator<Person> {
	private Logger log = Logger.getLogger(PersonComparatorByName.class);
	
	@Override
	public int compare(Person o1, Person o2) {
		/* log info */
		log.debug(o1.getName() + ".compareTo(" + o2.getName() + ") = " + (o1.getName().compareTo(o2.getName())));
		
		return o1.getName().compareTo(o2.getName());
	}
}
